<template>
  <div class="about-global">
    <c-header :active="type" @changeType="getType"></c-header>
    <div class="title">关于我们-PERGO历程</div>
    <div class="about-course">
      <div class="about-course-frist">
        <img class="a-banner-img" src="http://pergoqiniu.laigl.com/201912171759591101.png" alt="">
        <div class="about-course-cotent">
          <p class="about-course-year">{{companyListFrist.yeartxt}}</p>
          <p class="about-course-title">{{companyListFrist.title}}</p>
        </div>
      </div>
      <div class="about-course-list">
        <div v-for="(list, index) in companyList" :key="index">
          <div class="about-course-box" v-if="index%4 ==0">
            <div class="about-course-year">
              <p v-for="(curr, i) in companyList[index]" :key="i">
                <span class="about-course-title">{{curr.yeartxt}}</span>
                <span class="about-course-desc">{{curr.title}}</span>
              </p>
            </div>
          </div>
          <div class="about-course-bg" v-if="index==4*index-3">
            <div class="about-course-year">
              <div class="about-course-height" v-for="(item, j) in companyList[index]" :key="j">
                <p :class="[j%2==0 ? 'about-course-bg-r' : 'about-course-bg-l']">
                  <span v-if="j%2==0" class="about-course-desc">{{item.title}}</span>
                  <span v-else class="about-course-title">{{item.yeartxt}}</span>
                  <span v-if="j%2==0" class="about-course-title">{{item.yeartxt}}</span>
                  <span v-else class="about-course-desc">{{item.title}}</span>
                </p>
              </div>
            </div>
          </div>
          <div class="about-course-box-r" v-if="index==2*index-2">
            <div class="about-course-year">
              <p v-for="(curr, i) in companyList[index]" :key="i">
                <span class="about-course-desc">{{curr.title}}</span>
                <span class="about-course-title">{{curr.yeartxt}}</span>
              </p>
            </div>
          </div>
          <div class="about-course-bg about-course-active" v-if="index == 3 || index == 7 || index==11">
            <div class="about-course-year">
              <div class="about-course-height" v-for="(item, j) in companyList[index]" :key="j">
                <p :class="[j%2==0 ? 'about-course-bg-r' : 'about-course-bg-l']">
                  <span v-if="j%2==0" class="about-course-desc">{{item.title}}</span>
                  <span v-else class="about-course-title">{{item.yeartxt}}</span>
                  <span v-if="j%2==0" class="about-course-title">{{item.yeartxt}}</span>
                  <span v-else class="about-course-desc">{{item.title}}</span>
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="about-continue">精彩继续</div>
    <c-footer :type="type" @changeType="getType"></c-footer>
  </div>
</template>

<script>
  import {
    companyProcess
  } from '@/api/index'
  export default {
    data() {
      return {
        type: this.$route.query.type ? this.$route.query.type : 0,
        companyListFrist: [],
        companyList: []
      }
    },
    created() {
      companyProcess().then(res => {
        if (res.code == 200) {
          this.companyListFrist = res.data.rows[0][0]
          res.data.rows.splice(0, 1)
          this.companyList = res.data.rows
        }
      })
    },
    methods: {
      getType(type) {
        this.type = type
      },
    },
  }
</script>

<style lang="less" scoped>
  @font-face {
    font-family: Futura-Dem;
    src: url('http://pergoqiniu.laigl.com/font/Futura-Dem.otf');
  }
  .about-course-year{
    font-family: Futura-Dem;
  }
  .about-course-list::after {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    background: url(../../assets/img/about-white.png) no-repeat;
    background-size: 70%;
    position: absolute;
    top: -0.2rem;
    left: 50%;
    margin-left: -9px;
    margin-top: -14px;
    z-index: 999;
  }

  .about-course-list::before {
    content: '';
    display: block;
    width: 1px;
    height: 0.2rem;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: -0.2rem;
    left: 50%;
    z-index: 999;
  }

  .about-course .about-course-box {
    width: 100%;
    height: 5rem;
    position: relative;
    color: #000;
  }

  .about-course .about-course-box:after {
    content: '';
    display: block;
    position: absolute;
    height: 100%;
    width: 1px;
    background: #000;
    left: 50%;
    top: 0;
  }

  .about-course .about-course-box .about-course-year {
    position: absolute;
    left: 50%;
    margin-left: -1.81rem;
  }

  .about-course .about-course-box .about-course-year p {
    padding-top: 0.4rem;
    display: flex;
    align-items: center;
  }

  .about-course .about-course-box .about-course-title {
    font-family: Futura-Dem;
    font-size: 0.63rem;
    ;
    margin-right: 0.8rem;
    position: relative;
    display: inline-block;
  }

  .about-course .about-course-box .about-course-title:after {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    background: url(../../assets/img/about-blank.png) no-repeat;
    background-size: 70%;
    position: absolute;
    top: 50%;
    left: 1.81rem;
    margin-left: -9px;
    margin-top: -9px;
  }

  .about-course .about-course-box .about-course-desc {
    font-size: 0.21rem;
    display: inline-block;
    width: 2.89rem;
    font-size: 0.21rem;
  }

  .about-course .about-course-bg {
    position: relative;
    color: #fff;
    width: 100%;
    height: 7.4rem;
    background: url(../../assets/img/home.png) no-repeat;
    background-size: cover;
  }

  .about-course .about-course-bg:after {
    content: '';
    display: block;
    position: absolute;
    height: 100%;
    width: 1px;
    background: #fff;
    left: 50%;
    top: 0;
  }

  .about-course .about-course-bg .about-course-bg-l {
    position: absolute;
    left: 50%;
    margin-left: -1.81rem;
  }

  .about-course .about-course-bg .about-course-bg-r {
    position: absolute;
    right: 50%;
    margin-right: -1.81rem;
    display: flex;
    align-items: center;
  }

  .about-course .about-course-height {
    height: 1.7rem;
  }

  .about-course .about-course-bg .about-course-year p {
    padding-top: 0.4rem;
    display: flex;
    align-items: center;
  }

  .about-course .about-course-bg .about-course-bg-r .about-course-title {
    font-family: Futura-Dem;
    font-size: 0.63rem;
    ;
    margin-left: 0.8rem;
    position: relative;
    display: inline-block;
  }

  .about-course .about-course-bg .about-course-bg-l .about-course-title {
    font-family: Futura-Dem;
    font-size: 0.63rem;
    ;
    margin-right: 0.8rem;
    position: relative;
    display: inline-block;
  }

  .about-course .about-course-bg .about-course-bg-l .about-course-title:after {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    background: url(../../assets/img/about-white.png) no-repeat;
    background-size: 70%;
    position: absolute;
    top: 50%;
    left: 1.81rem;
    margin-left: -9px;
    margin-top: -9px;
  }

  .about-course .about-course-bg .about-course-bg-r .about-course-title:after {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    background: url(../../assets/img/about-white.png) no-repeat;
    background-size: 70%;
    position: absolute;
    top: 50%;
    right: 1.81rem;
    margin-right: -19px;
    margin-top: -9px;
  }

  .about-course .about-course-bg .about-course-desc {
    display: inline-block;
    font-size: 0.21rem;
    width: 2.89rem;
  }

  .about-course .about-course-box-r {
    width: 100%;
    height: 5rem;
    position: relative;
    color: #000;
  }

  .about-course .about-course-box-r:after {
    content: '';
    display: block;
    position: absolute;
    height: 100%;
    width: 1px;
    background: #000;
    left: 50%;
    top: 0;
  }

  .about-course .about-course-box-r .about-course-year {
    position: absolute;
    right: 50%;
    margin-right: -1.81rem;
  }

  .about-course .about-course-box-r .about-course-year p {
    padding-top: 20px;
    display: flex;
    align-items: center;
  }

  .about-course .about-course-box-r .about-course-title {
    font-family: Futura-Dem;
    font-size: 0.63rem;
    ;
    margin-left: 0.8rem;
    position: relative;
    display: inline-block;
  }

  .about-course .about-course-box-r .about-course-title:after {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    background: url(../../assets/img/about-blank.png) no-repeat;
    background-size: 70%;
    position: absolute;
    top: 50%;
    right: 1.81rem;
    margin-right: -19px;
    margin-top: -9px;
  }

  .about-course .about-course-box-r .about-course-desc {
    font-size: 0.21rem;
    display: inline-block;
    width: 2.89rem;
    text-align: right;
  }

  .about-course>div:last-child>div:before {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    background: url(../../assets/img/about-end.png) no-repeat;
    background-size: 70%;
    position: absolute;
    bottom: -18px;
    right: 50%;
    margin-right: -20px;
    margin-top: -15px;
    z-index: 100;
  }

  .about-course .about-course-active {
    background: url('http://pergoqiniu.laigl.com/20191217175959101.png') no-repeat;
    background-size: cover;
  }

  .about-course {
    .about-course-list {
      position: relative;
    }

    .about-course-frist {
      position: relative;

      .a-banner-img {
        display: block;
        width: 100%;
        height: 3.2rem;
      }

      .about-course-cotent {
        width: 96%;
        height: 80%;
        background: rgba(0, 0, 0, .5);
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        color: #fff;
        box-sizing: border-box;

        .about-course-year {
          font-size: 0.63rem;
        }

        .about-course-title {
          font-size: 0.21rem;
        }
      }
    }
  }

  .about-continue {
    text-align: center;
    margin: 0.54rem 0;
  }
</style>
